/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.db;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author mwiatrowski
 */
@Entity
@Table(name = "PROJECTS_HISTORY")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ProjectsHistory.findAll", query = "SELECT p FROM ProjectsHistory p"),
    @NamedQuery(name = "ProjectsHistory.findById", query = "SELECT p FROM ProjectsHistory p WHERE p.id = :id"),
    @NamedQuery(name = "ProjectsHistory.findByAuthor", query = "SELECT p FROM ProjectsHistory p WHERE p.author = :author"),
    @NamedQuery(name = "ProjectsHistory.findByCountExit", query = "SELECT p FROM ProjectsHistory p WHERE p.countExit = :countExit"),
    @NamedQuery(name = "ProjectsHistory.findByCountEntry", query = "SELECT p FROM ProjectsHistory p WHERE p.countEntry = :countEntry"),
    @NamedQuery(name = "ProjectsHistory.findByDateRegistration", query = "SELECT p FROM ProjectsHistory p WHERE p.dateRegistration = :dateRegistration"),
    @NamedQuery(name = "ProjectsHistory.findByDescription", query = "SELECT p FROM ProjectsHistory p WHERE p.description = :description"),
    @NamedQuery(name = "ProjectsHistory.findByPriority", query = "SELECT p FROM ProjectsHistory p WHERE p.priority = :priority")})
public class ProjectsHistory implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private BigDecimal id;
    @Column(name = "AUTHOR")
    private String author;
    @Column(name = "COUNT_EXIT")
    private BigDecimal countExit;
    @Column(name = "COUNT_ENTRY")
    private BigDecimal countEntry;
    @Column(name = "DATE_REGISTRATION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateRegistration;
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "PRIORITY")
    private String priority;
    @JoinColumn(name = "ID_PROJECTS", referencedColumnName = "ID_PROJECTS")
    @ManyToOne
    private Projects idProjects;

    public ProjectsHistory() {
    }

    public ProjectsHistory(BigDecimal id) {
        this.id = id;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public BigDecimal getCountExit() {
        return countExit;
    }

    public void setCountExit(BigDecimal countExit) {
        this.countExit = countExit;
    }

    public BigDecimal getCountEntry() {
        return countEntry;
    }

    public void setCountEntry(BigDecimal countEntry) {
        this.countEntry = countEntry;
    }

    public Date getDateRegistration() {
        return dateRegistration;
    }

    public void setDateRegistration(Date dateRegistration) {
        this.dateRegistration = dateRegistration;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getPriority() {
        return priority;
    }

    public void setPriority(String priority) {
        this.priority = priority;
    }

    public Projects getIdProjects() {
        return idProjects;
    }

    public void setIdProjects(Projects idProjects) {
        this.idProjects = idProjects;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProjectsHistory)) {
            return false;
        }
        ProjectsHistory other = (ProjectsHistory) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.db.ProjectsHistory[ id=" + id + " ]";
    }
    
}
